import os
import time
import unittest

from selenium.webdriver.common.by import By

from common.data_operation import DataOperation

from day8.autoframe.common.functions import open_browser
from page.Login_page import LoginPage
from page.index_page import IndexPege

class TestLgoin1(unittest.TestCase):

    def setUpClass(cls) -> None:
        # 1.#打开浏览器
        browser = open_browser()
        # 2.#创建page页面对象
        cls.login = LoginPage(browser)
        cls.index = IndexPege(browser)

        #登录
    def test_login(self):
        self.login.get(self.login.login_url)
        # base 封装一个隐式等待
        self.login.implicitly_wait()
        # 登录操作
        self.login.input_username("zxc123889")
        self.login.input_password("123456")
        self.login.login()
        # 断言登录
        username = self.index.font_text()
        self.assertEqual('zxc123889', username,)